BOOLEAN
WaitForKeyboardWrite(VOID)
{
INT i;
UCHAR c;
for (i = 0; i < 1000; ++i)
{
KeStallExecutionProcessor(50);
c = READ_PORT_UCHAR(defI8042_CTRL_PORT);
if ((c & defOBUFFER_FULL) == defOBUFFER_FULL)
break;
}
return i ? TRUE : FALSE;
}
VOID PressKeyByScanCode(
IN CONST BYTE ScanCode
)
{
WRITE_PORT_UCHAR(defI8042_CTRL_PORT, 0xd2);
typedef VOID (* PFN_KeyboardClassServiceCallback)(
IN PDEVICE_OBJECT DeviceObject,
IN PKEYBOARD_INPUT_DATA InputDataStart,
IN PKEYBOARD_INPUT_DATA InputDataEnd,
IN OUT PULONG InputDataConsumed
);